<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/2/28
 * Time: 17:30
 */

namespace addons\roll\model;

use think\Db;
use think\Model;

class RollprizeModel extends Model
{
    /**
     * 保存奖品到数据库
     * @param $data
     * @return int|string
     */
    public function addPrize($data){
        $re = Db::name('roll_prize')->insert($data);
        return $re;
    }

    /**
     * 查询奖品列表
     * @param $condition
     * @param $field
     * @return array|\PDOStatement|string|\think\Collection
     */
    public function getPrizeList($condition, $field){
        $re = Db::name('roll_prize')->field($field)->where($condition)->select();
        return $re;
    }

    /**
     * 获取会员列表
     * @param $condition
     * @param $field
     * @return array|\PDOStatement|string|\think\Collection
     */
    public function getMemberList($condition, $field){
        $re = Db::name('tm_member')->where($condition)->field($field)->select();
        return $re;
    }
}